home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mesolore
/
Mesolore - Disc 1.iso
/
mac
/
data
/
Nuttall Search.dir
/
00014_Script_14
< prev
next >
Wrap
Text File
|
2001-03-05
|
9KB
|
331 lines
Global gList,gLevelNum
global begin,gDataPool,gfirstTime,gShowSearch,gSearchNew,gStartSearchList
--on clearrepeats ---!!!
-- temp= the text of member "nuttall_search_list"
-- hmany = the number of lines in temp
-- repeat with x = 1 to hmany
-- if line x +1 of temp = "#" & (line x of temp) then
-- delete line x+1 of temp
-- end if
-- end repeat
-- put temp
--
--end
on preparemovie
sprite(21).visible = false
end
on startMovie
cursor 4
count = 10
gSearchNew = TRUE
gStartSearchList = []
put "" into field "output"
repeat while count < 17
put "" into field the member of sprite (value(count) +1)
sendSprite((value(count) +1), #beginSprite)
count = count +1
end repeat
--importFileInto member "nuttall_search_list", "nuttall_search_list.txt"
cursor 0
end
-----LISTS-----
--Called first by clicking on dropdown---
on load whList, whSprite
if whList = "more..." then abort
set gLevelNum = whSprite - 9
--createlist
whList = createList( whList)
if listP(value(whList)) then
put "more..." & Return into field the member of sprite value(whSprite +1)
repeat with x in value(whList)
put x & return after field the member of sprite value(whSprite +1)
end repeat
--- init dropDown
sendSprite(value(whSprite +1), #beginSprite)
--- loads next dropdown from 1st item in list
hold = line 2 of field the member of sprite value(whSprite +1)
--put hold
delete char 1 to 3 of hold
-- if no more lists abort
if hold = "" then
-- clear out following dropDowns
count = whSprite
repeat while count < 17
put "" into field the member of sprite (value(count) +1)
sendSprite((value(count) +1), #beginSprite)
count = count +1
end repeat
abort
end if
put "more..." & return into field the member of sprite value(whSprite +2)
load hold,(whSprite +1)
sendSprite(value(whSprite +1), #beginSprite)
end if
end
on createList(whList)
-- keep moving down the datapool so that you don't get bar from an earlier choice!!!!
if gLevelNum = 1 then
setDataPool whList
end if
temp = gDataPool
tempList = ""
begin = FALSE
howMany = the number of lines in temp
--- add #'s to front of searchword
repeat with z = 1 to gLevelNum -1
put "#" before whList
end repeat
if gLevelNum = 1 then
z = 1
else
z = getAT (gStartSearchList ,gLevelNum -1)
end if
---find searchword
repeat with x = z to howmany
if line x of temp = whList then
set begin = TRUE
exit repeat
end if
end repeat
setAt gStartSearchList, gLevelNum, x
x = x +1
repeat with x = x to howmany
holder = line x of temp
--- stop looping
if BEGIN = TRUE then
--- end of section
if char (gLevelNum-1) of holder = "#" and not(char gLevelNum of holder = "#") or not(holder contains "#")then
--- put line z to x of temp
exit repeat
end if
if char gLevelNum of holder = "#" and char gLevelNum +1 of holder <> "#"then
delete char 1 to gLevelNum of holder
put QUOTE & holder & QUOTE & "," after tempList --- add to list
end if
end if
end repeat
delete the last char of templist
return value("[" & tempList & "]")
end
on setDataPool whList
temp = the text of member "nuttall_search_list"
howMany = the number of lines in temp
repeat with x = 1 to howmany
if line x of temp = whList then
exit repeat
end if
end repeat
holder = line x of temp & RETURN
repeat with y = (x+1) to howMany
if line y of temp contains "#" then
put line y of temp & RETURN after holder
else
exit repeat
end if
end repeat
gDataPool = holder
end
-----SEARCHING---------
on search(searchList)
sprite(21).visible = true
if gSearchNew = TRUE then
searchNew(searchList)
else
searchResults(searchList)
end if
sprite(21).visible = false
end
on clearMores(searchList)
repeat with x = the number of items in searchlist down to 1
if item x of searchlist = "more..." then
delete item x of searchList
end if
end repeat
return searchlist
end
on searchNew(searchList)
put "" into field "output"
searchlist = clearMores(searchlist)
put searchlist
howMany = the number of items in searchList
repeat with x = 1 to the number of members of castLib 3
repeat with y = 2 to howMany
if field member x of castLib 3 contains item y of searchList then
if y = howmany then
findLine(searchList, x)
end if
else
exit repeat
end if
end repeat
end repeat
if field "output" = "" then
put "No matches found." into field "output"
else
put "Search Complete." after field "output"
beep
end if
set the forecolor of field "output" = 15
end
on searchResults(searchList)
howMany = the number of items in searchList
tempList = []
repeat with y = 1 to (the number of lines in field "output")-1
hack = word 1 of line y of field "output"
if hack <> "" then
append tempList, hack
end if
end repeat
put "" into field "output"
put templist
repeat with x in tempList
repeat with z = 2 to howMany
if field member value(x) of castLib 3 contains item y of searchList then
if z = howmany then
findLine(searchList, value(x))
end if
else
exit repeat
end if
end repeat
end repeat
if field "output" = "" then
put "No matches found." into field "output"
else
put "Search Complete." after field "output"
beep
end if
set the forecolor of field "output" = 15
end
on findLine(searchList,x)
howMany = the number of items in searchList
temp = field member x of castlib 3
holder = ""
repeat with z = 2 to howMany
put item z of searchlist & " " after holder
end repeat
delete the last char of holder
-- put holder
repeat with y = 1 to the number of lines in temp
if the mousedown then
sprite(21).visible = false
beep
abort
end if
---calendar name---
if searchlist contains"calendarname" then
if line y of temp contains holder then
put x && line 1 of temp && "--" && line y of temp & return & return after field "output"
end if
--- dates ---
else if searchlist contains"dates" then
if line y of temp contains holder then
put x && line 1 of temp && "--" && line y of temp & return & return after field "output"
end if
---personal name---
else if searchlist contains"personalname" then
testForQuotes = FALSE
repeat with z = 2 to howMany
if line y of temp contains item z of searchList then
if line y of temp contains quote & (item z of searchlist) or line y of temp contains (item z of searchlist) & QUOTE then
testForQuotes = TRUE
end if
if z = howMany and not(line y of temp contains":") and testForQuotes then
put x && line 1 of temp && "--" && line y of temp & return & return after field "output"
end if
else
exit repeat
end if
end repeat
----new---
else if searchlist contains"associated" then
repeat with z = 2 to howMany
if line y of temp contains item z of searchList then
if z = howMany and line y of temp contains"associated" then
put x && line 1 of temp && "--" && line y of temp & return & return after field "output"
end if
else
exit repeat
end if
end repeat
----new---
else
repeat with z = 2 to howMany
if line y of temp contains item z of searchList then
if z = howMany then
put x && line 1 of temp && "--" && line y of temp & return & return after field "output"
end if
else
exit repeat
end if
end repeat
end if
end repeat
end
--on cleanspaces --- from end of items in input list
-- temp = the text of member "nuttall_search_list"
-- howmany = the number of lines in temp
-- repeat with x = 1 to howmany
-- holder = line x of temp
-- repeat while the last char of holder = numtochar(32)
-- delete the last char of holder
-- end repeat
-- put holder into line x of temp
-- end repeat
-- put temp into the text of member "nuttall_search_list"
--end
on closewindow
gShowSearch = FALSE
pass
end